<template>
	<view class="">
		<topTitle :name="`收款银行账户信息`" back right class="bg_w"/>
		<view class="content">
			<view class="list">
				<view v-for="(item,index) in list" :key="index" class="flex f-a-c j-s-b li f14">
					<text>{{item.name}}</text>
					<input type="text" placeholder="请输入" class="color-9" v-model="item.value" style="text-align: right;">
				</view>
			</view>
			<view class="btn bg-theme color-w f16" @click="set">
				保存
			</view>
		</view>
	</view>
</template>

<script>
export default {
  data() {
    return {
      list:[{
				name: '开户银行',
				value: '',
			},{
				name: '账户名称',
				value: ''
			},{
				name: '银行账户',
				value: ''
			}]
    }
  },
  onLoad() {

  },
  methods: {
		set(){
			let data = this.list.filter(ele=>ele).map(ele=>ele.value)
			this.util.req(this.api.apiSaveBankInfo,{
				bank: data[0],
				bank_name: data[1],
				bank_number: data[2]
			}).then(res=>{
				this.util.log('保存成功,待审核')
				this.list = [{
					name: '开户银行',
					value: '',
				},{
					name: '账户名称',
					value: ''
				},{
					name: '银行账户',
					value: ''
				}]
			})
		}
  }
}
</script>

<style lang="scss">
	page{
		background: #f5f5f5;
		.list{
			margin: 40rpx 32rpx;
			background: #fff;
			border-radius: 16rpx;
			padding: 16rpx 20rpx;
			.li{
				padding: 36rpx 0;
				border-bottom: 2rpx solid #eee;
			}
			.li:last-child{
				border-bottom: 0;
			}
		}
		.btn{
			margin: 52rpx 30rpx;
			padding: 32rpx 0;
			border-radius: 20rpx;
			text-align: center;
			line-height: 1;
		}
	}
</style>
